<?php
/**
 * Created by PhpStorm.
 * User: alexlz
 * Date: 10/6/14
 * Time: 10:19 AM
 */

namespace sql;

if (!defined('NYMPH_ROOT')) {
  define('NYMPH_ROOT', dirname("../../../" . __FILE__));
  require(NYMPH_ROOT . '/local/loader/kernel/classes/URLClassLoader.php');
}

use parser\XMLParser;

abstract class XMLParserImpl extends XMLParser
{

   /**
   * (PHP 5)<br/>
   * Trying to parse some object
   * @param string $object
   * @return array array with parsed object
   */
  function parse($object)
  {
    $resultArray = null;
    $xmlFile = simplexml_load_file($object);
    foreach ($xmlFile->query as $query) {
      $key = $query['name'];
      $resultArray["'" . $key . "'"] = new SimpleSQLQuery($query);
    }
    return $resultArray;
  }
}